package com.hyc.result;

import com.hyc.enmus.ErrorEnum;

public class RespJson {
    private String code = new String();

    private String msg = new String();

    private Object data;


    public RespJson(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public RespJson(ErrorEnum em) {
        this.code = em.getErrorCode();
        this.msg = em.getMsg();
    }

    public RespJson() {
        this(ErrorEnum.SUCCESS);
    }

    public RespJson(Object data) {
        this.data = data;
        this.code = ErrorEnum.SUCCESS.getErrorCode();
        this.msg = ErrorEnum.SUCCESS.getMsg();
    }


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
